<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let arr1 = [1, 2, 5, 8, 4, 25, 12]
      let arr2 = [1, 3, 15, 8, 14, 25, 2]
      // 获取两数组的交集
      //   let arr = arr1.filter((item) => {
      //     return arr2.includes(item)
      //   })
      //   console.log(arr)

      // 求两数组的补集
      let arr = [...new Set(arr1.concat(arr2))]
      console.log(arr)
    </script>
  </body>
</html>
